package il.ac.bgu.soa2009.hw5;

public class ClientPortTypeProxy implements il.ac.bgu.soa2009.hw5.ClientPortType {
  private String _endpoint = null;
  private il.ac.bgu.soa2009.hw5.ClientPortType clientPortType = null;
  
  public ClientPortTypeProxy() {
    _initClientPortTypeProxy();
  }
  
  public ClientPortTypeProxy(String endpoint) {
    _endpoint = endpoint;
    _initClientPortTypeProxy();
  }
  
  private void _initClientPortTypeProxy() {
    try {
      clientPortType = (new il.ac.bgu.soa2009.hw5.RestaurantServiceServiceLocator()).getClientRestaurantService();
      if (clientPortType != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)clientPortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)clientPortType)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (clientPortType != null)
      ((javax.xml.rpc.Stub)clientPortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public il.ac.bgu.soa2009.hw5.ClientPortType getClientPortType() {
    if (clientPortType == null)
      _initClientPortTypeProxy();
    return clientPortType;
  }
  
  public il.ac.bgu.soa2009.hw5.schema.RestaurantDetails getRestaurantDetails() throws java.rmi.RemoteException{
    if (clientPortType == null)
      _initClientPortTypeProxy();
    return clientPortType.getRestaurantDetails();
  }
  
  public il.ac.bgu.soa2009.hw5.schema.BooleanResponse reserveTable(il.ac.bgu.soa2009.hw5.schema.TableReservation parameter) throws java.rmi.RemoteException{
    if (clientPortType == null)
      _initClientPortTypeProxy();
    return clientPortType.reserveTable(parameter);
  }
  
  public il.ac.bgu.soa2009.hw5.schema.BooleanResponse cancelReservation(il.ac.bgu.soa2009.hw5.schema.ReservationName parameter) throws java.rmi.RemoteException{
    if (clientPortType == null)
      _initClientPortTypeProxy();
    return clientPortType.cancelReservation(parameter);
  }
  
  
}